package com.agree.util.excel.handlers.mapping;

import com.agree.util.excel.entity.TableInfo;
import com.agree.util.excel.enums.MappingConfig;
import com.agree.util.excel.enums.MappingType;
import com.agree.util.excel.entity.InterfaceColMapEntity;

import java.io.IOException;
import java.util.List;

/**
 * Created by wangmu on 2017/12/4.
 */
public class DeleteMappingHandler extends MappingHandler {


    public DeleteMappingHandler(MappingConfig mappingConfig) {
        super(mappingConfig);
    }

    @Override
    public List<InterfaceColMapEntity> mapProperties(TableInfo tableInfo) throws IllegalAccessException, InstantiationException, IOException {
        this.configure(tableInfo);
        InterfaceColMapEntity reqHeader = getReqHeader(tableInfo);
        List<InterfaceColMapEntity> reqParams = getReqParams(tableInfo);
        reqParams.add(0,reqHeader);
        insertOrderNum(reqParams);
        return reqParams;
    }

    @Override
    protected MappingType getType() {
        return MappingType.SIMPLE_DELETE;
    }
}
